﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Lari.Configuration;

namespace Lari.Services.ViewModel
{
    public class RoleModel
    {
        public RoleModel(bool selectAllAccess=false)
        {
            SelectAllAccess = selectAllAccess;
        }
        public RoleModel()
        {
            SelectAllAccess = false;
        }
        public int Id { get; set; }

        [StringLength(30, ErrorMessage = MessageCode.Generic.LengthExceeded)]
        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        public string Name { get; set; }
        public List<ModuleModel> Modules { get; set; }
        public bool SelectAllAccess { get; private set; }
    }
}
